public class Text_3 {
    static class Solution {
        public int removeDuplicates(int[] nums) {

            int numsLength = nums.length;
            //快慢指针
            int fast = 1;
            int slow = 0;

            while(fast<numsLength){
                if(nums[slow]!=nums[fast]){
                    //根据slow进行定位
                    //把握好什么时候动什么时候不该动
                    slow++;
                    nums[slow] = nums[fast];
                }
                fast++;
            }

            return slow+1;
        }
    }
}
